Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • trfletch 598 posts 604 karma points
    Apr 09, 2009 @ 15:57
    trfletch
    0

    Don't display div is there are no child pages or related documents [SOLVED]

    Ok so I have a div on a page that is going to show a list of subpages and a list of related documents, what I want though is for the div not to show if neither of these two items exist (i.e. there are no subpages and no related documents). I realise I need to use an IF statement but I'm not sure exactly what it will be. I currently have the following code, as you will be able to see I have put an IF statement in to not show the related documents if there are not any but what I need is an IF statement to go around the whole lot so that if there are no sub pages and no related documents then the div does not show. Can anyone help??

    [code]





    You may also find helpful...










    [/code]

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Apr 09, 2009 @ 16:59
    Warren Buckley
    0

    Hi Tony,
    Just done this off the top of my head but it should work.

    [code]

  • trfletch 598 posts 604 karma points
    Apr 09, 2009 @ 18:16
    trfletch
    0

    Cheers Warren, that is almost exactly what I needed, I just had to change the "and" for an "or" and it does exactly what I wanted, I also added another IF statement in to stop it showing an empty

      when there were no child pages to show because it was causing a formatting issue, here is the final XSLT for anyone who is interested:

      [code][/code]

    Please Sign in or register to post replies

    Write your reply to:

    Draft